import axios from '../axios'

/*
 * 文章数据接口
 */

// 获取文章列表
export const getArticleList = (data) => {
    return axios({
        url: '/articles',
        method: 'get',
        data
    })
}

// 获取文章分类列表
export const getCategoryList = (data) => {
    return axios({
        url: '/categoryList',
        method: 'get',
        data
    })
}

export const getArticle = (data) => {
    return axios({
        url: '/article',
        method: 'get',
        data
    })
}

// 新增文章信息
export const saveArticle = (data) => {
    return axios({
        url: '/article',
        method: 'post',
        data
    })
}

// 编辑文章信息
export const updateArticle = (data) => {
    return axios({
        url: '/article',
        method: 'put',
        data
    })
}

// 删除文章列表
export const deleteArticle = (data) => {
    return axios({
        url: '/article',
        method: 'delete',
        data
    })
}
